// 封装和医院列表数据相关的函数
import { request } from '@utils/http'
import {
  IhospitalListParams,
  IhospitalListRes,
  IprovinceList,
} from './model/hospitalListTypes'
// 获取医院列表数据的函数
export function reqGetHospitalList({
  page,
  pageSize,
  hosname,
  hoscode,
  hostype,
  provinceCode,
  cityCode,
  districtCode,
  status,
}: IhospitalListParams) {
  return request.get<any, IhospitalListRes>(
    `/admin/hosp/hospital/${page}/${pageSize}`
  )
}

// 获取省级数据的接口

export function reqGetProvinceList(province: string = 'province') {
  return request.get<any, IprovinceList>(
    `/admin/cmn/dict/findByDictCode/${province}`
  )
}

// 获取市或区数据的接口
export function reqGetCityOrDistrictList(parentId: string) {
  return request.get<any, IprovinceList>(
    `/admin/cmn/dict/findByParentId/${parentId}`
  )
}
